package com.zzyl.mapper;

import com.zzyl.dto.BedDto;
import com.zzyl.entity.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BedMapper {

    /**
     * 根据房间id获取床位信息列表
     *
     * @param roomId 房间id
     * @return 床位对象列表
     */
    List<BedVo> getBedsByRoomId(@Param("roomId") Long roomId);

    void insert(Bed bed);

    @Select("select * from bed where id = #{id}")
    Bed selectById(Long id);

    @Update("update bed set bed_number = #{bedNumber}, update_by = #{updateBy}, update_time = #{updateTime}, sort = #{sort} where id = #{id}")
    void updateById(Bed bed);

    @Delete("delete from bed where id = #{id}")
    void deleteById(Long id);
}

